package com.mnsq.comment.bean.controller;

import com.mnsq.comment.bean.condition.CommentCondition;
import com.mnsq.common.bean.annotation.UserInfoRequired;
import com.mnsq.common.bean.entity.comment.CommentSubject;
import com.mnsq.common.controller.BaseController;
import com.mnsq.common.service.BaseService;
import matrix.module.common.bean.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO 评论、取消评论、添加操作日志等操作设计
 *
 * @author 周俭
 */
@RestController
@RequestMapping("/api/comment")
public class CommentController extends BaseController<CommentSubject, BaseService<CommentSubject, CommentCondition>, CommentCondition> {

    /**
     * TODO 点赞评论
     * 添加操作记录，操作类型
     *
     * @param commentCondition
     * @return
     */
    @PostMapping("/great")
    @UserInfoRequired(required = true)
    public Result greatComment(@RequestBody CommentCondition commentCondition) {
        return null;
    }

    /**
     * TODO 评论列表使用此接口，公共接口不满足需求
     * 1 查询并组装评论信息
     * 2 本人评论提供部分操作
     * 3 本人评论列表
     *
     * @return
     */
    @UserInfoRequired
    @PostMapping("/pageList")
    public Result queryPageList(@RequestBody CommentCondition commentCondition) {
        return null;
    }

    /**
     * TODO 查询内容评论数量
     *
     * @param commentCondition
     * @return
     */
    @UserInfoRequired
    @PostMapping("/queryCount")
    public Result queryCount(@RequestBody CommentCondition commentCondition) {
        return null;
    }
}
